package mapper;

import Conn.Conn;
import model.Test;

import java.sql.PreparedStatement;

public class DelName {
    /*
   类: DelName
   方法: Del
   方法说明:
       并将查询结果 将design 修改成 1 设置成假删除
    */
    private static PreparedStatement pstam;
    public boolean Del(Test test) {
        Conn conn = new Conn();
        try {
            pstam = conn.getConn().prepareStatement("update test set design = 1 where id = ?");
            pstam.setString(1,String.valueOf(test.getId()));
            int num = pstam.executeUpdate();
            if (num == 1){
                return true;
            }else {
                return false;
            }
        }catch (Exception e){
            e.printStackTrace();
            return false;
        }
    }
}
